#pragma once
#ifndef CAMERA_H
#define CAMERA_H

#include<AlphaTools.h>
class Camera
{
public:
	// Constuctor and destructor
	Camera(void);
	~Camera(void);

	// Functions that control the movement and rotation of the camera.  These generally work by manipulating 
	// the cameraFrame.
	inline void moveIn(){cameraFrame.moveForward(movement_rate);};
	inline void moveOut(){cameraFrame.moveForward(-movement_rate);};
	inline void strafeLeft(){cameraFrame.moveRight(movement_rate);};
	inline void strafeRight(){cameraFrame.moveRight(-movement_rate);};
	void moveForward();
	void moveBackward();
	inline void rotateAntiClockWise(float irotationrate){cameraFrame.rotateWorld(irotationrate,0,1,0);};
	inline void rotateUp(float irotationrate){cameraFrame.rotateLocalX(-irotationrate);};
	inline void resetForwardVector(){cameraFrame.setForwardVector(0,0,-1);};
	inline void resetUpVector(){cameraFrame.setUpVector(0,1,0);};

	// These functions apply the camera matrix to the scene
	void setCameraStatic(AlphaMatrixStack* imatrix);
	void setCamera(AlphaMatrixStack* imatrix);

	// The update is used to ensure the camera remains in the correct position in relation to the player.
	void update(AlphaVector iorigin, float iangle);

	// Functions for accessing and manipulating private or protected attributes
	inline AlphaFrame getFrame(){return cameraFrame;};
	inline int getCameraMode(){return camera_mode;};
	
private:
	AlphaFrame cameraFrame;
	//AlphaMatrix mCamera;
	float movement_rate;
	float rotation_rate;
	int camera_mode;				// Used to specify first-peron, third-person or free-roaming camera
};
#endif

